package com.cc.visitor.enums;

/**
 * @author chanchaw
 * @create 2024-10-07 15:32
 */
public enum RoleType {
    VISITOR_NORMAL(10,"10","普通访客"),VISITOR_VIP(11,"11","贵宾访客"),
    INTERVIEWEE_NORMAL(20,"20","普通受访者"),INTERVIEWEE_MANAGEMENT(21,"21","受访者管理层"),
    INTERVIEWEE_MANAGER(22,"22","受访者总经理"),INTERVIEWEE_ADMIN(23,"23","受访者管理员"),
    SECURITY_NORMAL(30,"30","保安公司普通员工"),SECURITY_MANAGEMENT(31,"31","保安公司管理层"),
    SECURITY_MANAGER(32,"32","保安公司总经理"),SECURITY_ADMIN(33,"33","保安公司管理员"),
    DEV_NORMAL(40,"40","普通开发人员"),DEV_MANAGEMENT(41,"41","开发人员管理层"),
    DEV_MANAGER(42,"42","开发人员总经理"),DEV_ADMIN(43,"43","开发人员管理员"),
    DEV_ME(44,"44","我"),
    ;
    private int id;
    private String sid;
    private String remark;
    public int getId() {return id;}
    public String getSid() {return sid;}
    public String getRemark() {return remark;}

    RoleType(int id, String sid, String remark) {
        this.id = id;
        this.sid = sid;
        this.remark = remark;
    }

    // 根据索引返回枚举值
    public static RoleType ofid(int id){
        for(RoleType item: RoleType.values()){
            if(item.getId() == id) return item;
        }
        return null;
    }

    public static RoleType ofsid(String sid){
        for(RoleType item: RoleType.values()){
            if(item.getSid().equals(sid)) return item;
        }
        return null;
    }
}
